package com.whut.controller;


import com.whut.model.Zlabelposition;
import com.whut.service.ZLabelPosition;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.ArrayList;

@Controller
@RequestMapping("/zLabel")
public class ZController {
    @Resource
    private ZLabelPosition ZLabelPosition;

    @ResponseBody
    @PostMapping("/setPosition")
    public int setPosition(Zlabelposition position) {
        return ZLabelPosition.setPosition(position);
    }

    @ResponseBody
    @PostMapping("/getPosition")
    public ArrayList getPosition(Integer projectId) {
        return ZLabelPosition.getPosition(projectId);
    }

    @ResponseBody
    @PostMapping("/getProblem")
    public ArrayList getProblem(String name) {
        return ZLabelPosition.getProblem(name);
    }

    @ResponseBody
    @PostMapping("/getProblemNum")
    public int[] getProblemNum(String projectName, Integer quality, Integer security) {
        return ZLabelPosition.getProblemNum(projectName,quality,security);
    }
}
